/*     */ package com.feeyin.radar.sys.controller;
/*     */ 
/*     */ import com.feeyin.radar.commons.DatePropertyEditor;
/*     */ import com.feeyin.radar.commons.Page;
/*     */ import com.feeyin.radar.commons.StringUtils;
/*     */ import com.feeyin.radar.listener.OnlineUserListener;
/*     */ import com.feeyin.radar.sys.model.ModelLog;
/*     */ import com.feeyin.radar.sys.service.ModelLogService;
/*     */ import com.feeyin.radar.sys.service.OnlineUserService;
/*     */ import java.util.Date;
/*     */ import java.util.HashMap;
/*     */ import java.util.Map;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import org.springframework.web.bind.ServletRequestDataBinder;
/*     */ import org.springframework.web.servlet.ModelAndView;
/*     */ import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
/*     */ import org.springframework.web.servlet.view.RedirectView;
/*     */ 
/*     */ public class SystemServiceController extends MultiActionController
/*     */ {
/*     */   private ModelLogService modelLogService;
/*     */   private OnlineUserService onlineUserService;
/*     */   private OnlineUserListener onlineUserListener;
/*     */   private String systemServiceManage;
/*     */   private String querySystemLog;
/*     */   private String onlineUser;
/*     */ 
/*     */   public ModelLogService getModelLogService()
/*     */   {
/*  40 */     return this.modelLogService;
/*     */   }
/*     */ 
/*     */   public void setModelLogService(ModelLogService modelLogService) {
/*  44 */     this.modelLogService = modelLogService;
/*     */   }
/*     */ 
/*     */   public OnlineUserService getOnlineUserService() {
/*  48 */     return this.onlineUserService;
/*     */   }
/*     */ 
/*     */   public void setOnlineUserService(OnlineUserService onlineUserService) {
/*  52 */     this.onlineUserService = onlineUserService;
/*     */   }
/*     */ 
/*     */   public OnlineUserListener getOnlineUserListener() {
/*  56 */     return this.onlineUserListener;
/*     */   }
/*     */ 
/*     */   public void setOnlineUserListener(OnlineUserListener onlineUserListener) {
/*  60 */     this.onlineUserListener = onlineUserListener;
/*     */   }
/*     */ 
/*     */   public String getSystemServiceManage() {
/*  64 */     return this.systemServiceManage;
/*     */   }
/*     */ 
/*     */   public void setSystemServiceManage(String systemServiceManage) {
/*  68 */     this.systemServiceManage = systemServiceManage;
/*     */   }
/*     */ 
/*     */   public String getQuerySystemLog() {
/*  72 */     return this.querySystemLog;
/*     */   }
/*     */ 
/*     */   public void setQuerySystemLog(String querySystemLog) {
/*  76 */     this.querySystemLog = querySystemLog;
/*     */   }
/*     */ 
/*     */   public String getOnlineUser() {
/*  80 */     return this.onlineUser;
/*     */   }
/*     */ 
/*     */   public void setOnlineUser(String onlineUser) {
/*  84 */     this.onlineUser = onlineUser;
/*     */   }
/*     */ 
/*     */   public ModelAndView display(HttpServletRequest request, HttpServletResponse response, ModelLog modelLog)
/*     */   {
/*  89 */     Map model = new HashMap();
/*  90 */     Page page = new Page();
/*     */ 
/*  92 */     if ((modelLog != null) && (
/*  93 */       (!StringUtils.isEmpty(modelLog.getUserName())) || 
/*  94 */       (modelLog.getParentFunctionId() != null) || (
/*  95 */       (modelLog.getStartDate() != null) && (modelLog.getEndDate() != null)))) {
/*  96 */       page.getPageList(this.modelLogService.getPageQueryModelLogsCount(modelLog).intValue(), null, request);
/*  97 */       model.put("modelLogs", this.modelLogService.getPageQueryModelLogs(modelLog, page));
/*  98 */       model.put("modelLog", modelLog);
/*     */     } else {
/* 100 */       page.getPageList(this.modelLogService.getPageModelLogsCount().intValue(), null, request);
/* 101 */       model.put("modelLogs", this.modelLogService.getPageModelLogs(page));
/*     */     }
/* 103 */     return new ModelAndView(getSystemServiceManage(), model);
/*     */   }
/*     */ 
/*     */   public ModelAndView preQuerySystemLog(HttpServletRequest request, HttpServletResponse response)
/*     */   {
/* 108 */     return new ModelAndView(getQuerySystemLog());
/*     */   }
/*     */ 
/*     */   public ModelAndView onlineUser(HttpServletRequest request, HttpServletResponse response)
/*     */   {
/* 113 */     Map model = new HashMap();
/* 114 */     model.put("result", request.getParameter("result"));
/* 115 */     Page page = new Page();
/* 116 */     page.getPageList(this.onlineUserService.getPageOnlineUsersCount().intValue(), null, request);
/* 117 */     model.put("users", this.onlineUserService.getPageOnlineUsers(page));
/* 118 */     return new ModelAndView(getOnlineUser(), model);
/*     */   }
/*     */ 
/*     */   public ModelAndView stopOnlineUser(HttpServletRequest request, HttpServletResponse response)
/*     */   {
/* 123 */     boolean result = false;
/* 124 */     int success = 0;
/* 125 */     String userId = request.getParameter("id");
/* 126 */     if (!StringUtils.isEmpty(userId)) {
/* 127 */       result = this.onlineUserListener.deleteUser(Integer.valueOf(Integer.parseInt(userId)), request.getSession());
/* 128 */       if (result) success = 1;
/*     */     }
/* 130 */     return new ModelAndView(new RedirectView("./systemService.do?action=onlineUser&result=" + success));
/*     */   }
/*     */ 
/*     */   protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception
/*     */   {
/* 135 */     binder.registerCustomEditor(Date.class, new DatePropertyEditor());
/*     */   }
/*     */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.controller.SystemServiceController
 * JD-Core Version:    0.6.0
 */